package com.kaluli.system.utils;

import java.util.List;


/**
 * Abstract interface for pagination information.
 * 
 * @author Oliver Gierke
 */
public interface Pageable<T> {
	
	/**
	 * 返回 当前页
	 * @return
	 */
	int getNumber();
	
	/**
	 * 返回总共多少页
	 * @return
	 */
	int getTotal();
	
	
	/**
	 * 返回 一页多少条数据
	 * @return
	 */
	int getNumberPerPage();

	/**
	 * 总共多少条数据
	 * @return
	 */
	int getTotalOfElements();
	
	/**
	 * 返回当前页面 开始的条数
	 * @return
	 */
	int getNumberOfElements();
	
	/**
	 * 返回当前页面结束的条数
	 * @return
	 */
	int getNumberEndOfElements();
	

	/**
	 * 返回查询的数据
	 * 
	 * @return
	 */
	List<T> getContent();

	/**
	 * Returns whether the {@link Slice} has content at all.
	 * 
	 * @return
	 */
	boolean hasContent();

	/**
	 * Returns whether the current {@link Slice} is the first one.
	 * 
	 * @return
	 */
	boolean isFirst();

	/**
	 * Returns whether the current {@link Slice} is the last one.
	 * 
	 * @return
	 */
	boolean isLast();

	/**
	 * Returns if there is a next {@link Slice}.
	 * 
	 * @return if there is a next {@link Slice}.
	 */
	boolean hasNext();

	/**
	 * Returns if there is a previous {@link Slice}.
	 * 
	 * @return if there is a previous {@link Slice}.
	 */
	boolean hasPrevious();

}
